using UnityEngine;

public class MapViewCat : MonoBehaviour
{
	private Transform eye;

	private float blinkTimer;

	private bool isBlink;

	private void Start()
	{
		eye = base.transform.Find("Eye");
		blinkTimer = Random.Range(3, 5);
	}

	private void Update()
	{
		if (isBlink && eye != null)
		{
			blinkTimer += Time.deltaTime * 5f;
			if (blinkTimer <= 0.5f)
			{
				eye.localScale = new Vector3(1f, 1f - blinkTimer / 0.5f * 0.9f, 1f);
				return;
			}
			if (blinkTimer <= 1f)
			{
				eye.localScale = new Vector3(1f, 0.1f + (blinkTimer - 0.5f) / 0.5f * 0.9f, 1f);
				return;
			}
			eye.localScale = new Vector3(1f, 1f, 1f);
			isBlink = false;
			blinkTimer = Random.Range(3, 5);
		}
		else
		{
			blinkTimer -= Time.deltaTime;
			if (blinkTimer <= 0f)
			{
				isBlink = true;
			}
		}
	}
}
